#ifndef Kalman_H
#define Kalman_H

#include "main.h"

// 定义卡尔曼滤波器的结构体
typedef struct {
    float Q; // 测量过程的协方差
    float R; // 测量误差的协方差
    float X; // 状态估计值
    float P; // 估计误差的协方差
    float K; // 卡尔曼增益
} KalmanFilter;

void kalmanFilterInit(KalmanFilter *kf, float Q, float R, float initialX, float initialP);
float kalmanFilterUpdate(KalmanFilter *kf, float measurement);

extern KalmanFilter kfp;

#endif
